package com.phalanxim.service;

/**
 * Created with IntelliJ IDEA.
 * User: Zhendong
 * Date: 8/23/12
 * Time: 8:15 PM
 * To change this template use File | Settings | File Templates.
 */
public enum UserType
{
  ADMINISTRATES(1), CUSTOMER(10), UNKNOWN (-1);

  private int value = -1;

  UserType(int value) {
    this.value = value;
  }

  public int getValue() {
    return this.value;
  }

  public static UserType forCode(int value)
  {
    for(UserType type : UserType.values())
    {
      if(value == type.value)
      {
        return  type;
      }
    }
    return UserType.UNKNOWN;
  }

}
